<?php 

session_start();
if (isset($_REQUEST['id'])){
    $id = $_REQUEST['id'];
    
}

if(!empty($id)){
    
   if(mysql_connect('localhost', 'root', '')){
       if(mysql_select_db($_SESSION["base"])){
           
           
     $query = "SELECT * FROM  `planocontas` WHERE `PLANOCONTAS_CONTA` LIKE '".mysql_real_escape_string($id)."%' ORDER BY `planocontas`.`PLANOCONTAS_CONTA`  DESC ;" ;	
     $query_run = mysql_query($query);
            echo 'Ultimos Registros.<br/>';
            echo '<table>';
     while ($query_row = mysql_fetch_assoc($query_run)){
         
		echo '<tr><td id="td_auto1" width="60">'. $conta = $query_row['PLANOCONTAS_CONTA'].'</td><td id="td_auto2" width="250">'.$query_row['PLANOCONTAS_NOME'].'</td></tr>';
	
		}
                echo '</table>';
       }
   } 
    
    
}

?>